# $Id$
# Maintainer: Greg Helton <gt@fallendusk.org>

pkgname=fbsplash
pkgver=1.5.4.2
pkgrel=1
pkgdesc="A userspace implementation of a splash screen for Linux (formerly known as gensplash)"
arch=('i686' 'x86_64')
url="http://fbsplash.berlios.de"
license=('GPL')
backup=('/etc/conf.d/fbsplash.conf')
depends=('initscripts' 'miscsplashutils' 'libjpeg' 'libpng' 'freetype2-static') 
conflicts=('bootsplash' 'gensplash')
install=fbsplash.install
source=(http://download.berlios.de/fbsplash/splashutils-${pkgver}.tar.bz2 \
	http://code.thewrecker.net/files/darch.tar.bz2 \
	fbsplash.inithooks \
	fbsplash.conf \
	fbsplash.initcpio_install \
	fbsplash.daemon \
	fbsplash_wrapper \
	splashfunctions.patch)

build() {
	cd ${startdir}/src/splashutils-${pkgver}
	
	# splashutils patches
	patch -p1 < ${startdir}/src/splashfunctions.patch
	
	# Configure, make, and install
	./configure --prefix=/usr --sysconfdir=/etc --enable-fbcondecor --with-gpm --with-mng --with-png --with-ttf --with-ttf-kernel
	make || return 1
	make DESTDIR=${startdir}/pkg install || return 1
	
	# Create directories
	mkdir -p ${startdir}/pkg/lib/splash/cache
	mkdir -p ${startdir}/pkg/etc/splash
	mkdir -p ${startdir}/pkg/etc/rc.d/functions.d

	# Install scripts
	install -D -m644 ${startdir}/src/fbsplash.initcpio_install ${startdir}/pkg/lib/initcpio/install/fbsplash
	install -D -m644 ${startdir}/src/fbsplash.conf ${startdir}/pkg/etc/conf.d/fbsplash.conf
	install -D -m744 ${startdir}/src/fbsplash.daemon ${startdir}/pkg/etc/rc.d/fbsplash
	
	# install darch fbsplash theme
	cp -r ${startdir}/src/darch ${startdir}/pkg/etc/splash/darch
	
	# install initscripts hooks
	install -D -m744 ${startdir}/src/fbsplash.init ${startdir}/pkg/etc/rc.d/functions.d/fbsplash.sh
}
